package com.miao.admin.controller;



import com.miao.common.entity.R;
import com.miao.common.entity.pojo.Purchase;
import com.miao.admin.service.AdminPurchaseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 进货记录表(Purchase)表控制层
 *
 * @author MiaoWenqing
 * @since 2021-02-03 15:47:35
 */
@RestController
@RequestMapping("admin/purchase")
public class AdminPurchaseController {
    /**
     * 服务对象
     */
    @Resource
    private AdminPurchaseService adminPurchaseService;


    @PostMapping("/add")
    public R purchaseAdd(@RequestBody Purchase purchase){
        if (this.adminPurchaseService.save(purchase)) {
            return R.ok();
        }else {
            return R.error();
        }
    }


}